package flc.ast.adapter;


import androidx.annotation.NonNull;

import com.chad.library.adapter.base.provider.BaseItemProvider;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import flc.ast.R;
import flc.ast.bean.StarsBean;
import stark.common.basic.adaptermutil.StkProviderMultiAdapter;
import stark.common.basic.adaptermutil.StkSingleSpanProvider;

public class StarOverviewAdapter extends StkProviderMultiAdapter<StarsBean> {

    public StarOverviewAdapter() {
        addItemProvider(new StkSingleSpanProvider(126));
        addItemProvider(new StarOverviewProvider());
    }

    private class StarOverviewProvider extends BaseItemProvider<StarsBean> {
        @Override
        public int getItemViewType() {
            return StkProviderMultiAdapter.TYPE_VIEW;
        }

        @Override
        public int getLayoutId() {
            return R.layout.item_star_overview;
        }

        @Override
        public void convert(@NonNull BaseViewHolder baseViewHolder, StarsBean bean) {
            baseViewHolder.setImageResource(R.id.ivStarOverviewItemImg, bean.getImg());
            baseViewHolder.setText(R.id.tvStarOverviewItemName, bean.getName());
            baseViewHolder.setText(R.id.tvStarOverviewItemDate, bean.getDate());
        }
    }

}
